package com.example.rabbit.controller;


import com.example.rabbit.service.Sender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:MuJiuTian
 * @Description:
 * @Date: Created in 下午10:23 2019/8/19
 */
@RestController
public class TopicController {

    @Autowired
    private Sender sender;
    
    //exchange 交换器名称
    @Value("${mq.config.topic.exchange}")
    private String exchange;

    @RequestMapping(value = "/sendAll")
    public void sendAll(){
        sender.send(exchange,"user.log.info","我是user.info日志");
        sender.send(exchange,"user.log.error","我是user.error");
        sender.send(exchange,"order.log.info","我是order.info日志");
        sender.send(exchange,"order.log.error","我是order.error");
        sender.send(exchange,"product.log.info","我是product.info日志");
        sender.send(exchange,"product.log.error","我是product.error");
    }
}
